﻿using System;
using System.Collections.Generic;
using MessagePack.Formatters;
using UnityEngine;

namespace MessagePack.Unity
{
	// Token: 0x02000138 RID: 312
	internal static class UnityResolveryResolverGetFormatterHelper
	{
		// Token: 0x0600049F RID: 1183 RVA: 0x00014440 File Offset: 0x00012840
		internal static object GetFormatter(Type t)
		{
			object result;
			if (UnityResolveryResolverGetFormatterHelper.formatterMap.TryGetValue(t, out result))
			{
				return result;
			}
			return null;
		}

		// Token: 0x040001F7 RID: 503
		private static readonly Dictionary<Type, object> formatterMap = new Dictionary<Type, object>
		{
			{
				typeof(Vector2),
				new Vector2Formatter()
			},
			{
				typeof(Vector3),
				new Vector3Formatter()
			},
			{
				typeof(Vector4),
				new Vector4Formatter()
			},
			{
				typeof(Quaternion),
				new QuaternionFormatter()
			},
			{
				typeof(Color),
				new ColorFormatter()
			},
			{
				typeof(Bounds),
				new BoundsFormatter()
			},
			{
				typeof(Rect),
				new RectFormatter()
			},
			{
				typeof(Vector2?),
				new StaticNullableFormatter<Vector2>(new Vector2Formatter())
			},
			{
				typeof(Vector3?),
				new StaticNullableFormatter<Vector3>(new Vector3Formatter())
			},
			{
				typeof(Vector4?),
				new StaticNullableFormatter<Vector4>(new Vector4Formatter())
			},
			{
				typeof(Quaternion?),
				new StaticNullableFormatter<Quaternion>(new QuaternionFormatter())
			},
			{
				typeof(Color?),
				new StaticNullableFormatter<Color>(new ColorFormatter())
			},
			{
				typeof(Bounds?),
				new StaticNullableFormatter<Bounds>(new BoundsFormatter())
			},
			{
				typeof(Rect?),
				new StaticNullableFormatter<Rect>(new RectFormatter())
			}
		};
	}
}
